package pack1;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Created by jack on 2017/7/2.
 */
public class Main {
    public static void main(String[] args)
    {
        System.out.println("main Start");

        //使用AnnotationConfigApplicationContext作Spring容器，接受输入一个配置类作为参数；
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AopConfig.class);

        DemoAnnotationService demoAnnotationService = context.getBean(DemoAnnotationService.class);

        DemoMethodService demoMethodService = context.getBean(DemoMethodService.class);

        demoAnnotationService.add();

        demoMethodService.add();

        context.close();
    }
}
